package com.mxpio.erp.common.technology.entity;

import com.mxpio.erp.common.equipment.entity.Equipment;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @Author : wpp
 * @Datetime : 2023/7/28 10:27
 * @Desc :
 * @Modor :  Modifytime:
 * @modDesc :
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_TECHNOLOGY_WORK_UNIT")
@Schema(description="作业单元")
public class WorkUnit extends BaseEntity {

    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "WORK_UNIT_CODE_", updatable = false)
    @Schema(description  = "作业单元编码")
    private String workUnitCode;

    @Column(name = "WORK_UNIT_NAME_" )
    @Schema(description  = "作业单元名称")
    private String workUnitName;

    @Column(name = "MAIN_WORKSHOP_")
    @Schema(description = "主制车间")
    @Dict(dicCode = "workShopCode",dicEntity = WorkShop.class,dicText = "workShopName")
    private String mainWorkshop;

    @Column(name = "WORK_CENTER_CODE_")
    @Schema(description = "所属工作中心")
    @Dict(dicCode = "workCenterCode",dicEntity = WorkCenter.class,dicText = "workCenterName")
    private String workCenterCode;
    /**工序类型*/
    @Column(name = "WORK_UNIT_TYPE_")
    @Schema(description  = "作业单元类型")
    @Dict(dicCode = "ERP_TECH_WORKUNIT_TYPE")
    private Integer workUnitType;

    @Column(name = "AUTOMATIC_REPORT_ABLE_")
    @Schema(description  = "自动报工")
    @Dict(dicCode = "ERP_COMMON_YESNO")
    private String automaticReportAble;

    /**是否启用*/
    @Column(name = "STATUS_")
    @Schema(description = "是否启用")
    @Dict(dicCode = "ERP_COMMON_YESNO")
    private String status;

    @Column(name = "BATCH_REPORT_ABLE")
    @Schema(description  = "批次报工")
    @Dict(dicCode = "ERP_COMMON_YESNO")
    private String batchReportAble;

    @Column(name = "IP_ADDRESS_")
    @Schema(description  = "IP地址")
    private String ipAddress;

/*    @Column(name = "PROC_GROUP_CODE_")
    @Schema(description  = "工序段编码")
    private String procGroupCode;

    @Column(name = "PROC_GROUP_NAME_" )
    @Schema(description  = "工序段名称")
    private String procGroupName;*/

    @Column(name = "PROCESS_CODE_")
    @Schema(description  = "工序编码")
    private String processCode;
    /**工序名称*/
    @Column(name = "PROCESS_NAME_" )
    @Schema(description  = "工序名称")
    private String processName;

    /**设备编码*/
    @Column(name = "BASICS_CODE_")
    @Schema(description = "设备资产编号")
    private String basicsCode;

    @Column(name = "EQP_NAME_")
    @Schema(description = "设备资产名称")
    private String eqpName;

    @Column(name = "EQP_CODE_")
    @Schema(description = "设备编码")//设备
    @Dict(dicCode="eqpCode", dicEntity = Equipment.class, dicText = "eqpName")
    private String eqpCode;

    @Column(name = "REPORT_MODE_")
    @Schema(description  = "报工方式")
    @Dict(dicCode = "ERP_TECH_REPORT_MODE")
    private String reportMode;
}
